package com.dx.mes.web;

import com.dx.mes.common.transcoder.util.JacksonUtil;
import com.dx.mes.facade.brm.service.IFbpbistoolService;
import com.dx.mes.facade.brm.tx.Fbpbistol.FbpbistolI;
import com.dx.mes.facade.brm.tx.Fbpbistol.FbpbistolO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@CrossOrigin(origins = "*", maxAge = 3600)
@Controller
public class QueryController {

    @Resource
    private IFbpbistoolService fbpbistoolService;


    @RequestMapping("/kanban/tool_status.do")
    @ResponseBody
    public FbpbistolO appLogin(@RequestParam("strInMsg") String strInMsg) {
        FbpbistolI inTrx = JacksonUtil.fromJson(strInMsg, FbpbistolI.class);
        FbpbistolO fbpbistolO = fbpbistoolService.queryTools(inTrx);
        return fbpbistolO;
    }

}
